package singleton;

/**
 * @author Brook
 *
 * 懒汉式线程安全，不推荐性能低
 */
public class Singleton4
{

    private static Singleton4 instance;

    private Singleton4() {

    }

    public synchronized static Singleton4 getInstance() {
        if (instance == null) {
            instance = new Singleton4();
        }
        return instance;
    }
}
